css and coding tables?

Category: Geeks r Us

Post 1 by Squiggles (Account disabled) on Friday, 05-Dec-2008 10:37:55

I am doing css for my website, however I want the table of links to be on each page I go to without having to add the table to every single page and think i can do such a thing with css. The problem is that the tutorial I refered to instructed me to not use html tagging in my CSS so therefore I could not add the table. But then i found this following code I could modify which also did not work.

<div id="csstable">
<div class="cssrow">
<div class="csscell">Stuff</div>
<div class="csscell">Stuff</div>
</div>
<div class="cssrow">
<div class="csscell">Stuff</div>
<div class="csscell">Stuff</div>
</div>


Question: how do I add a table with all my menu links in a css document without having to copy and paste it in each file.

I have writtena css file that defines a table, table.one. I then wrote a table in my index.htm and it took all the properties of the table.one that was defined in my .css file but that still means I have to copy and paste the table in each file. I want to just add a menu of links in a table, or would it best be done in list form? In either case i would like to do this with css. I am also a bit confused.

Please only respond if you have good experience with this.

Post 2 by blindndangerous (the blind and dangerous one) on Friday, 05-Dec-2008 19:25:27

I believe that you have to use HTML for this, and paste it into each of your pages. CSS is mainly used for colors and backgrounds.

Post 3 by Albanac (I'm going for the prolific poster awards!) on Saturday, 20-Dec-2008 17:45:40

It is also used for formatting text in other ways, alignment, much more. But as for the original question, (yes I know the account is disabled, but in case anyone else finds this useful), there are two ways I know of to do this, neither of which involve CSS.

Firstly if your web server supports php use an include file like so:
make a text file called, say, links.txt.
in this file put your menu links whichever way you want them.
then in each file you want to include that menu do this:

include("links.txt");

If this is to be the only bit of php you do then it needs to be:
<?php
include("links.txt");
?>
of course.

The other way involves using ssi, or server side includes. As I don't use these very often, I'm not so sure how they work. A quick google for the info should help you there though.

HTH, in some way at least.

Cheers,
Simon